Skip to content

refactor(latex): use String.raw and add escape checks - #26

Merged
rapjul merged 6 commits into
mainfrom
refactor/raw-latex-strings
Nov 3, 2026
Merged

rapjul merged 6 commits into
mainfrom
refactor/raw-latex-strings

Conversation

@rapjul

@rapjul rapjul commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

Replace escaped-backslash JavaScript and TypeScript strings used for rendered LaTeX with String.raw templates across the math UI, solver state, math engine, formula references, problem banks, and fixtures. Preserve interpolation and runtime output.

Add a focused AST-based check for escaped LaTeX control sequences in JavaScript, TypeScript, and Svelte. Run it on staged source files through lint-staged and scan src/, tests/, and scripts/ in CI.

Validation:

  • npm run lint:escaped-latex, the focused regression suite (4 files, 32 tests), npm run lint:imports, npm run check, npm run format:check, and npm run build pass.
  • The full unit suite reports 1,838 passing tests. Two local pages-static-server tests time out in this environment with jsdom's unsupported cross-document navigation; the four reviewed LaTeX regressions now have targeted coverage.
  • No dependencies were added.

Summary by CodeRabbit

  • Maintenance
    • Mathematical formulas, labels, hints, and practice content continue to display as before. Solver behavior and problem content are unchanged.
    • No user-facing functionality or displayed content changes in this release.

- Convert rendered LaTeX literals across the math UI and solver engines to raw templates.

- Preserve runtime backslashes and interpolation for equations, transforms, and piecewise systems.

- Retain regex, comment, and slash-sentinel syntax where raw templates do not apply cleanly.

- Verify output-sensitive math paths with 332 focused unit tests and full project checks.
@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 160e1260-6964-4119-a58a-612f66659718
Commits

Reviewing files that changed from the base of the PR and between 461f48b and 3b09dac.

Files selected for processing: 4
  • scripts/lint-escaped-latex.mjs
  • tests/unit/components/HintDisclosure.test.ts
  • tests/unit/components/MathText.test.ts
  • tests/unit/lint-escaped-latex.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Recent review details
Additional context used
Code guidelines: 2
.agents/code-style.md — auto-discovered
docs/adrs/0035-standardized-lib-path-aliases-for-components-and-solvers.md — auto-discovered
Path-based instructions: 2
Applicability reference: .agents/AGENTS.md: # Workspace Agent Rules — SignalLab (Analog Signal Processing Practice) For detailed requirements and specifications, see: [Code Style & Defensive Guidelines](code-style.md) Sour...

CodeRabbit inference engine (.agents/code-style.md)

Files:

  • tests/unit/components/HintDisclosure.test.ts
  • tests/unit/components/MathText.test.ts
  • tests/unit/lint-escaped-latex.test.ts
Applicability reference: .agents/AGENTS.md: # Workspace Agent Rules — SignalLab (Analog Signal Processing Practice) **Standardized `$lib` Path Aliases for Cross-Directory Imports**: All cross-directory imports across UI components (`$lib/co...

CodeRabbit inference engine (docs/adrs/0035-standardized-lib-path-aliases-for-components-and-solvers.md)

Files:

  • tests/unit/components/HintDisclosure.test.ts
  • tests/unit/components/MathText.test.ts
  • tests/unit/lint-escaped-latex.test.ts
Additional comments: 2
tests/unit/components/HintDisclosure.test.ts: 1

14-15: LGTM!

tests/unit/components/MathText.test.ts: 1

33-33: LGTM!

Also applies to: 95-101, 113-114, 159-159, 182-182

Walkthrough

This pull request changes LaTeX-containing strings to String.raw templates across components, math engines, problem banks, and tests. It adds a linter for escaped LaTeX commands and runs it through package scripts and practice verification.

Changes: LaTeX string migration

Layer / File(s) Summary
Component and solver strings
src/lib/components/*
Math inputs, formula displays, solver views, and feedback use raw templates for LaTeX strings.
Math engine strings
src/lib/math-engine/*
Generated formulas, prompts, hints, and notation strings use raw templates. Most output remains unchanged. formatTrial now selects explicit cosine and sine LaTeX commands.
Problem data and test coverage
src/lib/problems/bank/*, tests/*
Problem-bank strings and test inputs and expectations use raw templates. Tests add checks for KaTeX rendering and escaped-LaTeX detection.
Escaped-LaTeX linting
scripts/lint-escaped-latex.mjs, package.json, .github/workflows/practice-verification.yml
Adds a linter and wires it into staged-file checks and practice verification.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Refactor

Possibly related PRs

Merge Risk: Minimal · up to 3b09d

The change is mergeable with normal checks; no current correctness or workflow risk remains identified.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "refactor(latex): use String.raw and add escape checks" matches the main changes. The PR replaces escaped-backslash LaTeX strings with String.raw templates across the codebase and adds scrip…
Docstring Coverage Passed Docstring coverage is 97.30% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentati…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "refactor(latex): use String.raw and add escape checks" matches the main changes. The PR replaces escaped-backslash LaTeX strings with String.raw templates across the codebase and adds scripts/lint-escaped-latex.mjs, a lint check for escaped LaTeX commands wired into lint-staged and CI. The title is concise, uses a conventional-commit prefix, and names both primary parts of the change.

Full details: Docstring Coverage

Explanation

Docstring coverage is 97.30% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 111 functions across 98 files.

Finishing Touches
Simplify code
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Tip

🎯 Customize your risk assessments

Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.

✅ Automatic approvals, with your rules

Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T02:13:59.043625Z 3b09dac Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 605743b196

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/lib/math-engine/laplace/legacy.ts Resolved

@coderabbitai coderabbitai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Fix comments: Fix CodeRabbit comments on this PR

Comment thread src/lib/math-engine/laplace/legacy.ts Resolved

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

The String.raw conversion corrupted four literals, and three of them change what learners see: a KaTeX-comment bug in the Fourier-series power-threshold summary, an unterminated \text{} in the half-wave-sine derivation, and a mangled \frac{} in the Laplace elimination hint. All four were verified to throw in katex 0.18.2 (they render as red error text under the repo's throwOnError: false setting), and none is covered by the passing suite — these are display-only strings no test asserts on. Everything else in the conversion preserves values exactly.

Reviewed changes

  • Escaped-LaTeX literals → String.raw — roughly 350 escaped-backslash template and quoted string literals converted across math UI components, solver controllers and validation, the convolution/ODE/Fourier-series/CTFT/Laplace engines, the formula drawer, and the circuits/CTFT banks. Regex literals and \\ row-separator sentinels are deliberately left as escaped strings, which is correct — those are split/consumption contexts, not rendered LaTeX.
  • Value-preservation audit (this review) — compared the runtime value of every converted literal, recursively including literals inside ${…} interpolations, against the pre-refactor source: 587 pairs. Four regressions found (inline comments). The MathBlock.svelte restructure that moved real \n escapes into ${"\n"} interpolations, and the cos/sin branch splits in signals.ts / trial-algebra.ts / step7-decomposition.ts, all preserve values exactly. The mixed-policy conversions (String.raw inside a plain template's interpolation, e.g. circuits.ts promptLatex) also check out.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using glm-5.3-flash | 𝕏

Comment thread src/lib/math-engine/laplace/legacy.ts Resolved
- Add the AST-based checker for JavaScript, TypeScript, and Svelte strings and templates.

- Run the rule on staged source changes and in the full-source CI check.

- Cover escapes, String.raw, interpolation, Svelte expressions, comments, regexes, and path selection.

- Convert existing escaped LaTeX fixtures and evaluator replacement strings to String.raw.
@rapjul rapjul changed the title refactor: use String.raw for escaped LaTeX strings refactor(latex): use String.raw and add escape checks Nov 2, 2026
- Separate JavaScript and Svelte template traversal from general AST walking.

- Keep raw template bodies exempt while continuing to inspect interpolation expressions.

- Reduce complexity in the checker visitors flagged by CodeFactor.
- Close the fraction and text groups in Laplace and Fourier output.

- Preserve the percent escape in nested power-threshold labels.

- Add regression coverage that renders the affected formulas with KaTeX.

rapjul commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

Pushed follow-up commit 9dec4c1 to fix the four LaTeX regressions identified in review and add focused regression coverage. The focused suite passes (4 files, 32 tests); the full unit suite reports 1,838 passing tests, with two local pages-static-server navigation timeouts. I also reran the escaped-LaTeX lint, import lint, type check, format check, and production build successfully.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

The four corrupted LaTeX literals flagged in the prior review are still present verbatim at this head, and this PR's own untouched test suites now fail because of them — user-facing KaTeX rendering throws on the half-wave-sine Fourier path. This still blocks merge.

Reviewed changes — this pass re-reviewed the delta since the prior pullfrog review (commit ae8d011), including a value audit of every literal it converts and a full unit-suite run.

  • Added an AST-based escaped-LaTeX lint — scripts/lint-escaped-latex.mjs scans untagged JS/TS/Svelte strings for escaped control sequences via an allowlist; wired into CI, lint-staged, and covered by 4 focused tests (all passing). It reports clean on 437 source files at this head.
  • Converted the remaining escaped literals — 67 files, mostly unit/e2e test fixtures plus a few src/ regex-replacement strings (e.g. the pi rewrites in normalizeMathLatex), so the new lint scans clean over src/, tests/, and scripts/.
  • Value-preservation audit of the new commit — compared the runtime value of all 341 literal pairs converted by this commit, recursively into ${…} spans, against the previous head: one value change found (inline comment). Everything else, including the nested String.raw templates in transform-notation.test.ts, preserves values exactly.
  • Full unit suite re-run — 1,834 passed, 4 failed. All four failures are regressions from this PR, detailed below.

🚨 Prior corruption regressions remain, and the suite now proves they are PR-introduced

The four literals flagged in the prior review were not fixed by this commit: the untagged inner template in FourierSeriesCanvas.svelte:541, the unterminated \text{…} in generator.ts:130, the mangled \frac in elimination.ts:58, and the missing denominator braces in legacy.ts:358 are all unchanged. New hard evidence: fourier-series-tutor-contracts.test.ts:82 now fails twice with KaTeX parse error: … expected '}' at end of input: …d\end{gathered} — that is exactly the corrupted step-2 latex from generator.ts:130, rendered for the half_wave_sine path — and fourier-series-generation-compatibility.test.ts fails twice on half_wave_sine sha256 snapshot digests, meaning the refactor changed generated problem output. Neither test file nor its snapshots is modified anywhere in this PR, so both suites were green on main and regressed here; they are not pre-existing failures inherited from the base, and the PR description's "already present on the previous PR head" refers to 605743b — the commit that introduced them.

Technical details
# Four corrupted `String.raw` literals from the prior review remain at `ae8d011`

## Affected sites
- src/lib/components/canvas/FourierSeriesCanvas.svelte:541 — inner template `` `$N_{${percent}\%}=${powerThresholds[key]}$` `` still untagged; `\%` cooks to a bare `%` and comments out the KaTeX segment
- src/lib/math-engine/fourier-series/generator.ts:130 — `String.raw`…`must both be evaluated`` still missing its closing `}`; now proven user-facing by two KaTeX ParseError test failures
- src/lib/math-engine/laplace/its-scaffolding/elimination.ts:58 — still `\frac{${previous…}{${factor…}` (numerator close brace became `{`, denominator close brace dropped); feeds the teaching hint at elimination.ts:95
- src/lib/math-engine/laplace/legacy.ts:358 — both `\frac` denominators still missing `}` before `\right\}`

## Required outcome
- All four literals byte-identical to their pre-refactor values (see the open inline threads for the exact required strings).
- `fourier-series-tutor-contracts.test.ts` and `fourier-series-generation-compatibility.test.ts` pass with NO snapshot updates — the digests must return to their committed values.

## Suggested approach (optional)
- Fixing the four strings restores the generator output byte-for-byte, which resolves both failing suites without touching snapshots or test files.

ℹ️ The new lint cannot detect the corruption classes this PR actually shipped

lint:escaped-latex going green is not evidence of value preservation for this PR: the scanner only flags escaped \\command sequences, so it is blind to braces mangled inside already-raw strings (all four regressions above pass it), to untagged inner templates, and to single-backslash quoted operands — "\pi" at CtftStepSolver.test.ts:47 and the \% at FourierSeriesCanvas.svelte:541 both pass. Worth knowing when relying on it as a guard; no change requested.

Technical details
# Lint coverage gap relative to this PR's failure modes

## Affected sites
- scripts/lint-escaped-latex.mjs — `ESCAPED_CONTROL_SEQUENCE = /(?:\\\\)+([A-Za-z]+)/g` matches only doubled backslashes followed by letters

## Required outcome
- None (informational). If the lint is meant to prevent recurrence of this PR's regressions, note that it only guards the "escaped string left unconverted" class, not value corruption inside raw strings or untagged/quoted single-backslash operands.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using glm-5.3-flash | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues — the four LaTeX regressions from the prior review are fixed and verified; the one remaining item is the minor inline thread from the previous review (CtftStepSolver.test.ts:47), which is unchanged by these commits.

Reviewed changes — this pass re-reviewed the delta since the last review (commits a119c7f and 9dec4c1), with a runtime-value audit of every literal they touch and a re-run of the affected suites.

  • Fixed all four corrupted literals — the inner $N_{…\%}…$ template in FourierSeriesCanvas.svelte is now String.raw-tagged, the closing } of \text{ must both be evaluated} is restored in generator.ts, the \frac{X}{Y} braces are restored in elimination.ts, and both denominator braces are restored in legacy.ts. Each was compared old-vs-new and is byte-identical to its pre-refactor value.
  • Added targeted regression coverage — KaTeX renderToString no-throw tests for the half-wave-sine symmetry step and the legacy inverse trig pairs, a \frac{1}{2} hint assertion in the elimination suite, and a zero-.katex-error assertion on the power-threshold summary. Notably, fourier-series-generation-compatibility.test.ts and its sha256 snapshots pass again with no snapshot edits, confirming generated problem output is byte-identical to main.
  • Split the lint's AST visitors into helper functions — behavior-neutral extraction in scripts/lint-escaped-latex.mjs (a String.raw-tagged template never recurses into its template nodes, so the removed parent check was unreachable); the lint reports identically on 437 files and its four focused tests pass.
  • Verification — 85 tests across the seven affected suites pass; npm run lint:escaped-latex passes; working tree stays clean (no snapshot churn). The value audit of this delta surfaced only the intentional fixes and mispairing artifacts in the moved lint code, no new corruptions.

Pullfrog  | Fix it ➔ | View workflow run | Using glm-5.3-flash | 𝕏

@rapjul

rapjul commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 9dec4c15cc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

- Preserve the backslash in the exact CTFT weight answer used by the component test.

- Keep the regression test exercising the same escaped `\pi` operand as before the refactor.

- Confirm the focused test, escaped-LaTeX check, and formatting check pass.

rapjul commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

Pushed 461f48b to preserve the \pi runtime value in the CTFT component test’s nested interpolation. The focused test (30 tests), escaped-LaTeX lint, and formatting check pass.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — this pass re-reviewed the delta since the prior pullfrog review (commit 9dec4c1): a single one-line commit, verified with a runtime-value probe, the focused CTFT suite, and the escaped-LaTeX lint.

  • Fixed the last open review thread — the quoted "\pi" operand (which cooked to bare pi) inside the String.raw expected template in CtftStepSolver.test.ts is now a nested String.raw`\pi template, restoring the pre-refactor runtime value so the helper again types the escaped answer form \pi e^{-j(…)}. Verified: the probe confirms String.raw`\pi equals the original "\\pi" value, tests/unit/components/CtftStepSolver.test.ts passes 30/30, and npm run lint:escaped-latex stays clean on 437 source files. With this, all five pullfrog review threads on the PR are resolved and every flagged literal is value-identical to main.

Pullfrog  | View workflow run | Using glm-5.3-flash | 𝕏

@coderabbitai coderabbitai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Fix comments: Fix CodeRabbit comments on this PR

Comment thread scripts/lint-escaped-latex.mjs Resolved
Comment thread scripts/lint-escaped-latex.mjs Resolved
- Add missing Greek and math commands to the escaped LaTeX rule.
- Cover escaped `\beta`, `\gamma`, and `\lambda` in a regression test.
- Use a Biome compatible regex scan loop and convert existing `\lambda` fixtures to `String.raw`.

rapjul commented Nov 3, 2026

Copy link
Copy Markdown
Owner Author

Pushed follow-up commit 3b09dac addressing the two latest CodeRabbit findings.

  • Expanded the escaped-LaTeX command set to include \beta, \gamma, \lambda, and related project math commands, with regression coverage for the three reported commands.
  • Reworked the scanner loop to avoid an assignment expression that Biome rejects.
  • Converted existing \lambda test fixtures to String.raw so the full check can recognize them without changing their runtime text.

Verified with the full npm run lint:escaped-latex scan (437 files), the focused unit suites (22 tests), svelte-check (0 errors and warnings), and Prettier.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — this pass re-reviewed the delta since the prior pullfrog review (commit 461f48b): one commit, 3b09dac, verified against the real files at head with the repo-wide escaped-LaTeX lint and the three touched test suites.

  • Expanded the lint allowlist — scripts/lint-escaped-latex.mjs now recognizes beta, gamma, lambda, Gamma, Lambda, epsilon, Sigma, Phi, Psi, Theta, mathbf, and prod as commands that must not appear escaped. The repo-wide scan still reports clean on all 437 source files, so nothing else in src/, tests/, or scripts/ trips the new entries.
  • Converted the remaining escaped \lambda fixtures — the two hint strings in HintDisclosure.test.ts and the MathText.test.ts sample are now String.raw templates. None contains a ${…} span, so raw and cooked values coincide and the strings are value-identical to their escaped forms; both consuming component suites pass.
  • Restructured the regex scan loop — scanRawText replaces the assignment-in-condition while with an explicit null-check break; behavior-neutral, confirmed by the lint suite.
  • Added a regression test for escaped Greek commands to tests/unit/lint-escaped-latex.test.ts (now 5 tests), following the file's existing escapedBackslash fixture pattern.
  • Verification — npm run lint:escaped-latex passes on 437 files; lint-escaped-latex.test.ts, HintDisclosure.test.ts, and MathText.test.ts pass 22/22. All pullfrog review threads on the PR are resolved.

Pullfrog  | View workflow run | Using glm-5.3-flash | 𝕏

@rapjul

rapjul commented Nov 3, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 3b09dac36a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

There are no active review issues blocking approval.

No open issues 🎉

What changed in this PR

Standardizes LaTeX strings across the math engine, guided solvers, and Svelte UI using String.raw, preserving interpolation and rendered notation while reducing manual backslash escaping.

Changes:

  • Converts formulas, hints, previews, problem-bank content, and test fixtures to raw templates.
  • Adds focused escape-check tests and integrates the check with staged-file validation and CI.
  • Adds regression assertions for LaTeX rendering and fraction hints.
File Description
tests/​unit/​ui-components.test.ts Converts hint fixtures to raw templates.
tests/​unit/​transform-notation.test.ts Converts notation fixtures and interpolated prefixes.
tests/​unit/​odes-solver.test.ts Converts sinusoidal inputs and expected solutions.
tests/​unit/​ode-step-solver-validation.test.ts Converts preview assertions.
tests/​unit/​ode-solver-state.test.ts Converts quadratic and complex-root expectations.
tests/​unit/​ode-its-generator.test.ts Converts generated-response fixtures and assertions.
tests/​unit/​ode-formatting-helpers.test.ts Converts homogeneous-response expectations.
tests/​unit/​ode-choice-regressions.test.ts Converts sinusoidal forcing fixture.
tests/​unit/​mathtext.test.ts Converts standalone-macro fixtures and test description.
tests/​unit/​mathblock.test.ts Converts environment wrappers and multiline fixtures.
tests/​unit/​lint-escaped-latex.test.ts Tests escape detection, exclusions, and path scanning.
tests/​unit/​laplace.test.ts Converts expectations and adds inverse-pair rendering coverage.
tests/​unit/​laplace-support.test.ts Converts support and impulse assertions.
tests/​unit/​laplace-ode-tutor.test.ts Converts expected jump fraction.
tests/​unit/​laplace-input-entry.test.ts Converts invalid fraction-input fixture.
tests/​unit/​laplace-formatting.test.ts Converts signal and rational-format expectations.
tests/​unit/​laplace-fixtures.ts Converts transform-pair fixtures.
tests/​unit/​laplace-elimination.test.ts Converts fractions and checks elimination hint notation.
tests/​unit/​laplace-construction.test.ts Converts degree-hint assertion.
tests/​unit/​laplace-constant-preview.test.ts Converts placeholder assertions.
tests/​unit/​laplace-choice-presentation.test.ts Converts impulse-choice expectation.
tests/​unit/​laplace-answer-entry.test.ts Converts placeholders and response labels.
tests/​unit/​laplace-algebra.test.ts Converts transform and validation fixtures.
tests/​unit/​input-builders.test.ts Converts synthesized-expression fixtures.
tests/​unit/​fraction.test.ts Converts fraction inputs and expectations.
tests/​unit/​fourier-transform.test.ts Converts transform-pair assertions.
tests/​unit/​fourier-transform-bank.test.ts Converts operator-format assertions.
tests/​unit/​fourier-series-tutor-contracts.test.ts Adds symmetry-explanation rendering coverage.
tests/​unit/​fourier-series-symbolic-derivations.test.ts Converts frequency inputs and series assertions.
tests/​unit/​fourier-series-step-solver.test.ts Converts scientific-notation inputs and integral assertion.
tests/​unit/​fourier-series-review-regressions.test.ts Converts interpolated frequency expectations.
tests/​unit/​fourier-series-math-contracts.test.ts Converts frequency fixtures and expression delimiters.
tests/​unit/​fourier-series-its-generator.test.ts Converts coefficient and harmonic expectations.
tests/​unit/​fourier-series-distractor-regressions.test.ts Converts synthesis delimiter.
tests/​unit/​fourier-expression-oracle.ts Converts normalization and environment markers.
tests/​unit/​formatting.test.ts Converts formatting inputs and expectations.
tests/​unit/​evaluator.test.ts Converts LaTeX-bearing test descriptions.
tests/​unit/​ctft-tutor.test.ts Converts tutor answers and validation fixtures.
tests/​unit/​ctft-presentation.test.ts Converts exact-fraction and impulse expectations.
tests/​unit/​ctft-answer-validation.test.ts Converts interpolated validation expression.
tests/​unit/​convolution-symbolic-grading.test.ts Converts infinity checks.
tests/​unit/​convolution-step-solver-lifecycle.test.ts Converts infinity input and assertion.
tests/​unit/​convolution-pulse-formatting.test.ts Converts pulse-format expectations.
tests/​unit/​convolution-expression-validation.test.ts Converts symbolic and infinity fixtures.
tests/​unit/​convolution-beginner-workflow.test.ts Converts infinity-input fixtures.
tests/​unit/​constant-proofs.test.ts Converts symbolic-domain regression expressions.
tests/​unit/​configured-convolution.test.ts Converts triangle-signal expectation.
tests/​unit/​components/​OdeResponseInput.test.ts Converts harmonic output assertions.
tests/​unit/​components/​MathText.test.ts Converts rendering and fallback fixtures.
tests/​unit/​components/​MathInputBar.test.ts Converts placeholder and input fixtures.
tests/​unit/​components/​MathInline.test.ts Converts inline-rendering fixtures.
tests/​unit/​components/​MathBlock.test.ts Converts display and multiline-environment fixtures.
tests/​unit/​components/​HintDisclosure.test.ts Converts mathematical hint fixtures.
tests/​unit/​components/​FourierSeriesReviewRegressions.test.ts Converts period-label delimiter.
tests/​unit/​components/​FourierSeriesInput.test.ts Converts coefficient inputs and synthesis assertions.
tests/​unit/​components/​FourierSeriesCanvas.test.ts Adds threshold-summary rendering-error assertion.
tests/​unit/​components/​FourierCoefficientCard.test.ts Converts coefficient and harmonic fixtures.
tests/​unit/​components/​CtftStepSolver.test.ts Converts guided answers and display assertions.
tests/​unit/​components/​ConvolutionStepSolver.test.ts Converts infinity recap assertion.
tests/​unit/​circuits.test.ts Converts transfer-function assertion.
tests/​unit/​canonical-transform.test.ts Converts impulse replacement and frequency fixture.
tests/​e2e/​practice-correctness.spec.ts Converts Laplace browser-entry expressions.
tests/​e2e/​ctft-module.spec.ts Converts exact-pi display assertion.
tests/​e2e/​ctft-browser.ts Converts generated browser answers.
src/​routes/​+error.svelte Converts route-specific error-page formulas.
src/​lib/​problems/​bank/​fourier-transform-bank.ts Converts problem prompts, answers, and solution steps.
src/​lib/​math-engine/​transform-notation.ts Converts command tokens and replacement strings.
src/​lib/​math-engine/​real-evaluation.ts Converts pi symbol alias.
src/​lib/​math-engine/​odes/​solver.ts Converts harmonic solution templates.
src/​lib/​math-engine/​odes/​its-scaffolding/​trial-algebra.ts Uses explicit raw sine and cosine templates.
src/​lib/​math-engine/​odes/​its-scaffolding/​step7-decomposition.ts Converts stability prompt and harmonic basis.
src/​lib/​math-engine/​odes/​its-scaffolding/​step5-coefficients.ts Converts systems, substitutions, and coefficient summaries.
src/​lib/​math-engine/​odes/​formatting.ts Converts scientific and harmonic formatting.
src/​lib/​math-engine/​laplace/​transform.ts Converts quadratic-root description.
src/​lib/​math-engine/​laplace/​signals.ts Converts impulse and trigonometric signal formatting.
src/​lib/​math-engine/​laplace/​pfd.ts Converts partial fractions and convergence-region notation.
src/​lib/​math-engine/​laplace/​legacy.ts Converts transform pairs and generated solution templates.
src/​lib/​math-engine/​laplace/​its-scaffolding/​teaching.ts Converts teaching hints and signal choices.
src/​lib/​math-engine/​laplace/​its-scaffolding/​support.ts Converts interval bounds and piecewise assembly.
src/​lib/​math-engine/​laplace/​its-scaffolding/​shared.ts Converts root, degree, and coefficient guidance.
src/​lib/​math-engine/​laplace/​its-scaffolding/​roc.ts Converts imaginary-axis prompt.
src/​lib/​math-engine/​laplace/​its-scaffolding/​ode.ts Converts derivative frames and initial conditions.
src/​lib/​math-engine/​laplace/​its-scaffolding/​inverse.ts Converts pairing-field labels and separators.
src/​lib/​math-engine/​laplace/​its-scaffolding/​forward.ts Converts factor-count and quadratic-root frames.
src/​lib/​math-engine/​laplace/​its-scaffolding/​elimination.ts Converts equation systems and division hints.
src/​lib/​math-engine/​laplace/​construction.ts Converts construction previews and placeholders.
src/​lib/​math-engine/​laplace/​answer-entry.ts Converts field placeholders and response labels.
src/​lib/​math-engine/​laplace/​algebra.ts Converts rational-expression formatting.
src/​lib/​math-engine/​fraction.ts Converts fraction output template.
src/​lib/​math-engine/​fourier-transform/​presentation.ts Converts impulse weights and display replacement.
src/​lib/​math-engine/​fourier-transform/​its-scaffolding/​lesson.ts Converts phase and impulse-weight templates.
src/​lib/​math-engine/​fourier-transform/​its-scaffolding/​guidance.ts Converts frequency input labels.
src/​lib/​math-engine/​fourier-transform/​its-scaffolding/​derivation.ts Converts half-width frequency template.
src/​lib/​math-engine/​fourier-transform/​engine.ts Converts transform pairs and worked solutions.
src/​lib/​math-engine/​fourier-series/​its-scaffolding/​step7-series.ts Converts synthesis distractors and hints.
src/​lib/​math-engine/​fourier-series/​its-scaffolding/​step6-evaluation.ts Converts evaluation choices and identity hint.
src/​lib/​math-engine/​fourier-series/​its-scaffolding/​step5-integrals.ts Converts integral replacements and feedback.
src/​lib/​math-engine/​fourier-series/​its-scaffolding/​step4-form.ts Converts representation guidance.
src/​lib/​math-engine/​fourier-series/​its-scaffolding/​step1-period-freq.ts Converts frequency aliases and period hints.
src/​lib/​math-engine/​fourier-series/​generator.ts Converts generated explanations and series notation.
src/​lib/​math-engine/​fourier-series/​frequency.ts Converts exact-frequency and scientific formatting.
src/​lib/​math-engine/​formatting.ts Converts derivative symbols and replacement strings.
src/​lib/​math-engine/​evaluator.ts Converts normalization replacements and piecewise markers.
src/​lib/​math-engine/​convolution/​pulse-formatting.ts Converts rectangular-pulse templates.
src/​lib/​math-engine/​convolution/​its-scaffolding/​presentation.ts Converts bounds, piecewise output, and integral choices.
src/​lib/​math-engine/​convolution/​its-scaffolding/​intervals.ts Converts integral setup and interval summaries.
src/​lib/​math-engine/​convolution/​its-scaffolding/​helpers.ts Converts timing, transition, and definition guidance.
src/​lib/​math-engine/​convolution/​its-scaffolding/​evaluation-terms.ts Converts integrands and antiderivative templates.
src/​lib/​math-engine/​convolution/​engine.ts Converts generated convolution solution steps.
src/​lib/​math-engine/​convolution/​configured-solver.ts Converts fractions, intervals, and exponential response.
src/​lib/​math-engine/​convolution/​configuration.ts Converts triangular-signal templates.
src/​lib/​math-engine/​circuits.ts Converts circuit prompts and solution formulas.
src/​lib/​components/​ui/​OdePracticeCard.svelte Converts response labels and plot title.
src/​lib/​components/​ui/​formula-drawer/​FourierFormulaReference.svelte Converts Fourier reference formulas.
src/​lib/​components/​ui/​ConvolutionPracticeCard.svelte Converts worked-solution assembly and separators.
src/​lib/​components/​solvers/​OdeFullSolutionView.svelte Converts root and coefficient solution displays.
src/​lib/​components/​solvers/​ode-steps/​step2-substeps/​OdeStep2Quadratic.svelte Converts complex-root input labels.
src/​lib/​components/​solvers/​ode-steps/​OdeStep7PartAZiZs.svelte Converts zero-input explanation and superposition summary.
src/​lib/​components/​solvers/​ode-steps/​OdeStep6InitialConditions.svelte Converts constants and target-value summaries.
src/​lib/​components/​solvers/​ode-solver-state/​step5-coefficients-validation.ts Converts coefficient feedback.
src/​lib/​components/​solvers/​ode-solver-state/​step2-roots-validation.ts Converts root-validation formulas and messages.
src/​lib/​components/​solvers/​ode-solver-state/​ode-previews.ts Converts quadratic and complex-root previews.
src/​lib/​components/​solvers/​laplace-steps/​LaplaceConstructionInput.svelte Converts conjugate-root label.
src/​lib/​components/​solvers/​laplace-solver-state/​controller.svelte.ts Converts preview placeholders and term summaries.
src/​lib/​components/​solvers/​fourier-series-steps/​FourierSeriesStep4Form.svelte Converts representation-choice formulas.
src/​lib/​components/​solvers/​fourier-series-step-solver.svelte.ts Converts frequency-validation feedback.
src/​lib/​components/​solvers/​ctft-solver-state/​controller.svelte.ts Converts impulse-weight validation targets.
src/​lib/​components/​solvers/​convolution-steps/​ConvolutionStep6Evaluation.svelte Converts bound-evaluation prompts.
src/​lib/​components/​solvers/​convolution-steps/​ConvolutionStep4Transitions.svelte Converts transition summaries and breakpoint labels.
src/​lib/​components/​solvers/​convolution-steps/​ConvolutionStep3Flip.svelte Converts selected-signal summary.
src/​lib/​components/​solvers/​convolution-steps/​ConvolutionIntervalDiagram.svelte Converts fixed and moving signal labels.
src/​lib/​components/​solvers/​convolution-solver-state/​controller.svelte.ts Converts convolution-definition feedback.
src/​lib/​components/​math/​PoleZeroInput.svelte Converts rational and partial-fraction templates.
src/​lib/​components/​math/​PiecewiseIntervalInput.svelte Converts interval conditions and cases assembly.
src/​lib/​components/​math/​PhasorInput.svelte Converts defaults, labels, and phasor output.
src/​lib/​components/​math/​OdeResponseInput.svelte Converts harmonic response terms.
src/​lib/​components/​math/​MathInputBar.svelte Converts placeholder and symbol shortcuts.
src/​lib/​components/​math/​MathInline.svelte Converts display-style prefix.
src/​lib/​components/​math/​MathBlock.svelte Converts environment wrappers while preserving newlines.
src/​lib/​components/​math/​FourierSeriesInput.svelte Converts coefficient defaults, normalization, and synthesis.
src/​lib/​components/​math/​FourierCoefficientCard.svelte Converts coefficient placeholders.
src/​lib/​components/​canvas/​FourierSeriesCanvas.svelte Converts spectrum labels and power-threshold summary.
src/​lib/​components/​canvas/​CtftSpectrum.svelte Converts displayed impulse weights.
package.json Adds lint command and expands staged-source checks.
.github/​workflows/​practice-verification.yml Runs escaped-LaTeX validation in CI.

Review effort: Balanced

@rapjul
rapjul merged commit 9f39e58 into main Nov 3, 2026
11 checks passed
@rapjul
rapjul deleted the refactor/raw-latex-strings branch November 3, 2026 02:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants